home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2004 April / Gamestar_61_2004-04_dvdb.iso / DVDStar / Editace / hltp.exe / {app} / Source Code / VirtualDub / disasm / readme.txt < prev   
Text File  |  2003-10-01  |  4KB  |  88 lines

  1. disasm - Disassembly module compiler for VirtualDub
  2. Copyright (C) 2002 Avery Lee, All Rights Reserved
  3.  
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8.  
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. GNU General Public License for more details.
  13.  
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18.  
  19. =============================================================================
  20. Changelog
  21. =============================================================================
  22. V1.2      Released with VirtualDub 1.5.2
  23.  
  24. - Fixed bad PREFETCH opcodes.
  25.  
  26. V1.1      Released October 31, 2002 with VirtualDub 1.4.11
  27.  
  28. - Fixes several bad instruction rules, most notably all the floating-
  29.   point instructions that took memory arguments that were crashing the
  30.   disassembler.  Thanks to Glenn Maynard for noticing this.
  31.  
  32. - Compiler checks format strings for string/byte mismatches.
  33.  
  34. =============================================================================
  35. Explanation
  36. =============================================================================
  37. When VirtualDub crashes, it takes a snapshot of the current stack and code
  38. around EIP, and produces a crash dump that I can use to diagnose the cause
  39. of the failure.  Part of this process is producing a disassembly.  IA-32
  40. (x86) is non-trivial to parse, and the current version of VirtualDub
  41. (1.4.10) requires a table to drive the disassembler.  disasm's job is to
  42. compile that table.
  43.  
  44. The table itself is a list of rules, which are sequentially applied against
  45. the code bytes.  When one matches, the rule's result string is expanded to
  46. produce the disassembly for that instruction.  Rules may embed other sets
  47. of rules as part of their pattern; this functionality avoids having to
  48. replicate rules for the mod-reg-mem (modrm) and scale-index-base (sib) bytes.
  49. Full documentation for the pattern matching and result languages is included
  50. in the ia32.txt file.
  51.  
  52. There are two ways you can run disasm:
  53.     disasm
  54.     disasm <source.txt> <dst.bin>
  55.  
  56. In the first case, the source is assumed to be 'ia32.txt' and the destination
  57. 'ia32.bin'.  Disasm will read the source file and attempt to compile it.  If
  58. the compilation fails, an error will be printed.  Otherwise, disasm will write
  59. out the compiled module, and then attempt to test the module against some of
  60. its own code.  If you have trouble compiling disasm, it may be due to
  61. P4/Athlon instructions in test1(); you can safely delete the offending
  62. instructions from this function as it is never executed.
  63.  
  64. Once the disassembler module (ia32.bin) is produced, you can do two things
  65. with it.  The usual use is to feed it as input to the 1.1 version of mapconv
  66. to fold it into the VirtualDub.vdi file, but you can also copy the ia32.bin
  67. file to the VirtualDub directory as ia32.vdi.  VirtualDub looks for this
  68. file on a crash and will use the disassembler table in it before using the
  69. table in VirtualDub.vdi; this allows the table to be updated without having
  70. to recompile the debug module.  You can also rename the .vdi file from a
  71. newer version of VirtualDub to ia32.vdi to use it on an older version,
  72. provided that the table format in the newer file is not incompatible.
  73.  
  74. VirtualDub has a special command-line option to test the disassembler:
  75.     virtualdub /fsck
  76.  
  77. This will execute a rather strange instruction and manually trigger the
  78. crash dialog.  Note that the disassembler in disasm.exe is slightly older
  79. than the module in 1.4.10 -- the 1.4.10 disassembler fixes a couple of
  80. cosmetic bugs (most notably symbol lookup syntax).  The table formats are
  81. the same, however.
  82.  
  83. If you have any questions or comments, I'd like to hear them.  Let me know
  84. if any instructions are missing or decoded incorrectly.
  85.  
  86. -- Avery Lee <phaeron@virtualdub.org>
  87.    October 31, 2002
  88.